<?php
$book=[
    ['id'=>1,'auhtor'=>'zhangsan','bookName'=>'html5','price'=>'35'],
    ['id'=>2,'auhtor'=>'zs','bookName'=>'html5','price'=>'35'],
    ['id'=>3,'auhtor'=>'gs','bookName'=>'html5','price'=>'35'],
];
if(!empty($_POST['name'])){
    $authotName=$_POST['name'];
    $book=array_filter($book,function($v) use ($authotName){
        return $v['auhtor']==$authotName;
    });
}
if(!empty($_POST['min'])&&!empty($_POST['max'])){
    $min=$_POST['mix'];
    $max=$_POST['max'];
    $book=array_filter($book,function($v) use ($min,$max){
        return $v['price']>=$min&&$v['price']<=$max;
    });
}

?>




<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <form action="" method="post">
        <input type="text" placeholder="请输入作者" name='name'>
        <input type="submit" value="查询">
    </form>
    <table>
        <tr>
            <td>编号</td>
            <td>作者</td>
            <td>书名</td>
            <td>价格</td>
        </tr>
        <?php
        foreach($book as $value){?>
        <tr><td><?php echo $value['id'];?></td>
            <td><?php echo $value['auhtor'];?></td>
            <td><?php echo $value['bookName'];?></td>
            <td><?php echo $value['price'];?></td>
        </tr>
        <?php }
        ?>
    </table>
</body>
</html>